#include <QtGui/QApplication>
#include <QtGui/QVBoxLayout>
#include <QtCore/QDebug>

#include "DoneWidget.h"

DoneWidget::DoneWidget(QWidget *parent) : QWidget(parent)
{
    initUI();

    connect(m_doneButton, SIGNAL(clicked()), this, SLOT(doneButtonClicked()));
}

void DoneWidget::initUI()
{
    QVBoxLayout *mainLayout = new QVBoxLayout;
    QHBoxLayout *buttonLayout = new QHBoxLayout;

    m_doneLabel = new QLabel(tr("congratulations, your job is done, it will take effect the next time you reboot, please dont do any changes"));
    m_doneLabel->setWordWrap(true);
    m_doneButton = new QPushButton(tr("done"));
    m_doneButton->setFixedWidth(100);

    buttonLayout->addSpacing(200);
    buttonLayout->addWidget(m_doneButton);

    mainLayout->addWidget(m_doneLabel);
    mainLayout->addLayout(buttonLayout);
    //mainLayout->addWidget(m_doneButton);

    setLayout(mainLayout);
}

void DoneWidget::doneButtonClicked()
{
    qApp->quit();
}
